#!/bin/bash
kill `cat srv.pid 2>/dev/null` 2>/dev/null
if [ "$1" -a  "$1" =  "stop" ]
then
    echo "stoppped"
else
    echo "restarted"
    nohup perl server1.pl --debug 0 >srv.log 2>srv.err &
    echo $! >srv.pid
fi
